<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class Skus extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'sku_id' => $this->id,
            'attributes' => $this->attrs,
            'hash_key' => $this->hash_key,
            'cover' => Images::make($this->cover),
            'price' => $this->price,
            'stock' => $this->stock,
        ];
    }
}
